#pragma once

//
//  Unsigned types

/// Unsigned 64 bit
typedef unsigned long long uint64;
/// Unsigned 32 bit 
typedef unsigned int uint32;
/// Unsigned 16 bit
typedef unsigned short int uint16;
/// Unsigned 8 bit
typedef unsigned char uint8;

//
//  Signed types

/// Signed 64 bit
typedef long long int64;
/// Signed 32 bit
typedef int int32;
/// Signed 16 bit
typedef short int int16;
/// Signed 8 bit 
typedef char int8;

//
//  Float point

#ifdef AS_FLOAT
typedef float Float;
#else
typedef double Float;
#endif

// 
//  Policies
struct Policy {
  enum Enum {
    AllowUserManagement = 1<<0, 
    AllowMail           = 1<<1,
    AllowFileSharing    = 1<<2,
    AllowCalendar       = 1<<3,
    AllowToDo           = 1<<4,
    AllowDirectory      = 1<<5,
    AllowTime           = 1<<6,
    DenyAll             = 1<<7
  };
  typedef int8 Type;
};

//
//  Codes
struct Code {
  enum Enum {
    // Common
    Okay          = 0x0000,
    InternalError = 0x0001,

    // US
    US_DBDoesntRespond  = 0x0301,
    US_QueryError       = 0x0302,
    US_DataFetchError   = 0x0303,

    // FS
    FS_FunctionCallFailure  = 0x0601,
    FS_Forbidden            = 0x0602,
    FS_SendFailure          = 0x0603,
    FS_AssemblyFailure      = 0x0604,
  };
  typedef enum Enum Type;
};
